package metalink.student;

import java.io.File;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import java.sql.*;
import vo.*;
import vo.mixed.*;
import model.admin.*;
import myutil.*;



public class SendStudentMessage extends ActionSupport{
	String subject="";
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	public String getBody() {
		return body;
	}
	public void setBody(String body) {
		this.body = body;
	}
	public File getAttached_file() {
		return attached_file;
	}
	public void setAttached_file(File attached_file) {
		this.attached_file = attached_file;
	}
	public String getFile_name() {
		return file_name;
	}
	public void setFile_name(String file_name) {
		this.file_name = file_name;
	}
	public String getIndividual_students_emails() {
		return individual_students_emails;
	}
	public void setIndividual_students_emails(String individual_students_emails) {
		this.individual_students_emails = individual_students_emails;
	}
	String body="";
	File attached_file;
	String file_name;
	String individual_students_emails;
	public String execute(){
		ArrayList<String>receiver_ids=new ArrayList<String>();
		String[] divided=individual_students_emails.split(";");
		for(String single:divided){
			receiver_ids.add(single);
		}
 		
		
		new Common_Message().update_message_table(receiver_ids, body,subject, attached_file, file_name);
        return SUCCESS;	
	}
	

}
